#include<iostream>
using namespace std;
#include<cmath>

#include"library.h"

double v(double t){
	return 10*t - t*t;
}
// 5t^2 - t^3/3
const double exact=500-1000.0/3;

int main(){

	double y;
	for(int n=10;n<1E7;n*=10){
		y = integ_trapzoid(0, 10, n, v);
		cout<<"n="<<n<<"\t integral="<<y<<"\t\t error="<< y - exact << endl;
	}
	return 0;
}
